package consitentComposite;

import java.awt.PageAttributes.OriginType;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;

public class safeCompositeController {

	@FXML
	private TextField managername;
	@FXML
	private TextField constuctorname;
	
	@FXML
	private TextArea text;
	
	@FXML
	private Button manager_add_btn;
	@FXML
	private Button manager_delete_btn;
	@FXML
	private Button constuctor_add_btn;
	@FXML
	private Button constuctor_delete_btn;
	@FXML
	private Button show;
	
	private Orginzation org = null;
	

	@FXML
	private void initialize() {
		org = new Orginzation();
		
	}
	
	@FXML
	private void manager_add_click() {
		String str = managername.getText();
		Manager p = new Manager(str);
		org.addElement(p);
		
		
	}
	@FXML
	private void manager_delete_click() {
		String str = managername.getText();
		org.deleteElement(str,1);

	}
	@FXML
	private void constructor_add_click() {
		String str = constuctorname.getText();
		Constructor p = new Constructor(str);
		org.addElement(p);
	}
	@FXML
	private void constructor_delete_click() {
		String str = managername.getText();
		org.deleteElement(str,2);
	}

	@FXML
	private void getdetail() {
		String str = org.getMessage();
		text.setText(str);
	}
	
	
}
